import request from "@/utils/request";
import cfg from "@/config/config";

const schedule = {
  //添加规律排班
  addScheduleGuiLv: param => {
    return request("post", cfg.apiUrl + "api/schedule/addScheduleGuiLv", param);
  },
  //添加普通排班
  addSchedulePuTong: param => {
    return request(
      "post",
      cfg.apiUrl + "api/schedule/addSchedulePuTong",
      param
    );
  },
  //添加启用个人排班
  addScheduleGeRen: param => {
    return request("post", cfg.apiUrl + "api/schedule/addScheduleGeRen", param);
  },
  //更新启用个人排班
  updateSchedule: param => {
    return request("post", cfg.apiUrl + "api/schedule/updateSchedule", param);
  },
  //右键人排班
  updateScheduleByList: param => {
    return request(
      "post",
      cfg.apiUrl + "api/schedule/updateScheduleByList",
      param
    );
  },
  //根据日期更新排班
  updateScheduleByDate: param => {
    return request(
      "post",
      cfg.apiUrl + "api/schedule/updateScheduleByDate",
      param
    );
  },
  //删除排班
  deleteSchedule: param => {
    return request("post", cfg.apiUrl + "api/schedule/deleteSchedule", param);
  },
  //删除查询到的排班
  deleteScheduleFind: param => {
    return request(
      "post",
      cfg.apiUrl + "api/schedule/deleteScheduleFind",
      param
    );
  },
  //获取排班数据
  getScheduleList: param => {
    return request("post", cfg.apiUrl + "api/schedule/getScheduleList", param);
  },
  //获取规律排班
  getScheduleGuiLv: () => {
    return request("post", cfg.apiUrl + "api/schedule/getScheduleGuiLv");
  },
  //获取普通排班
  getSchedulePuTong: () => {
    return request("post", cfg.apiUrl + "api/schedule/getSchedulePuTong");
  },
  //显示班次信息 param{"bh":班次编号}
  /**
   * 返回参数 "sbsj":"21:30","xbsj":"30:15","banciName":"夜班3+8"
   */
  getBanci: param => {
    return request("post", cfg.apiUrl + "api/schedule/getBanci", param);
  }
};

export default schedule;
